package xcmg.device.dao.mapper.agent;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xcmg.device.dao.entity.agent.ServiceBasicDataAgentDO;
import xcmg.device.service.vo.agent.ServiceBasicDataAgentVO;
import yb.ecp.fast.infra.infra.PageCommonVO;
import yb.ecp.fast.infra.infra.SearchCommonVO;

import java.util.List;
import java.util.Map;


/**
 * 代理商数据字典 Mapper
 * @author huhuawei
 */
@Mapper
@Repository
public interface ServiceBasicDataAgentMapper {

    PageCommonVO list(SearchCommonVO<ServiceBasicDataAgentVO> condition);

    List<ServiceBasicDataAgentDO> queryList(ServiceBasicDataAgentVO condition);

    ServiceBasicDataAgentDO selectByPrimaryKey(@Param("id") String id);

    int insert(ServiceBasicDataAgentDO model);

    int merge(ServiceBasicDataAgentDO model);

    int updateByPrimaryKeySelective(ServiceBasicDataAgentDO bean);

    int updateByPCode(@Param("oldPCode") String pCode,@Param("newPCode") String newPCode,@Param("orgId") String orgId);


    int deleteByPrimaryKeySelective(String id);

    Integer checkDoesItExistByName(@Param("name") String name, @Param("orgId") String orgId);

    /**
     * 根据条件查询岗位信息
     *
     * @param param
     * @return
     */
    List<ServiceBasicDataAgentDO> queryJobListByMap(Map<String, Object> param);

    int getCodeCount(@Param("orgId") String orgId,@Param("pCode") String pCode,@Param("code") String code);

    ServiceBasicDataAgentDO selectByRemark(@Param("remark") String remark, @Param("orgId") String orgId);

}
